public class T04_SynchronizedTest implements Runnable {
  
  private int count = 100;
  
  public static void main(String[] args) {
    T04_SynchronizedTest t = new T04_SynchronizedTest();
    for (int i = 0; i < 100; i++) {
      new Thread(t, "Thread" + i).start();
    }
  }
  
  @Override
  public  void run() {
    synchronized (T04_SynchronizedTest.class) {
      count--;
      System.out.println(Thread.currentThread().getName() + "count= " + count);
    }
  }
}
